package com.zjuh.goodboy.web.modules.screen.crm;

import com.zjuh.goodboy.biz.ao.AdminAO;
import com.zjuh.goodboy.web.common.base.BaseScreen;
import com.zjuh.splist.core.form.Form;
import com.zjuh.splist.web.RunData;
import com.zjuh.splist.web.TemplateContext;
import com.zjuh.sweet.result.Result;

public class ItemExprDetail extends BaseScreen {

	private AdminAO adminAO;
	
	@Override
	protected void handleExecute(RunData rundata, TemplateContext templateContext) {
		Form form = rundata.getForm("itemExpr.update");
		int id = rundata.getQueryString().getInt("id");
		Result result = adminAO.queryItemExprDetail(id);
		if (result.isSuccess()) {
			if (!form.isHeldValues()) {
				form.holdValues(result.getModels().get("itemExpr"));
			}
			this.result2Context(result, templateContext);
		} else {
			this.handleError(result, rundata, templateContext);
		}
	}

	public void setAdminAO(AdminAO adminAO) {
		this.adminAO = adminAO;
	}

}
